package com.cloudfun.msglisten.entity;

import com.cloudfun.msglisten.common.constant.SysDictType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created by Huqin on 2019/12/28
 */
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "sys_dict")
public class SystemDictionaryEntity {

    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @Column(name = "dict_key", columnDefinition = ("varchar(64) not null comment '关键字'"))
    private String key;

    @Column(columnDefinition = ("varchar(32) not null comment '类型'"))
    @Enumerated(EnumType.STRING)
    private SysDictType type;

    @Column(name = "dict_value", columnDefinition = ("varchar(256) not null comment '值'"))
    private String value;
}
